package cn.jbooter.restweb.autoconfigure.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;

import cn.jbooter.restweb.autoconfigure.exception.handler.GlobalExceptionHandlerExceptionResolver;
import cn.jbooter.restweb.autoconfigure.properties.WebInfoProperties;


/**
 * web层的一些公共配置
 * @author hejian
 *
 */
public class RestWebConfigure {
	
	@Autowired
	private WebInfoProperties webInfoProperties;

	/**
	 * web全局异常拦截器
	 * @return
	 */
	@Bean
	public GlobalExceptionHandlerExceptionResolver exceptionHandlerResolver () {
		GlobalExceptionHandlerExceptionResolver rs = new GlobalExceptionHandlerExceptionResolver();
		rs.setDefaultErrorView(webInfoProperties.getDefaultErrorView());
		return rs;
	}
	
	
}
